Comparing Future Red Tide Scenarios
For this test run, I took the SEDAR Red Grouper stock assessment and used SSMSE to introduce future red tide events in the OM and EM. There were 6 total scenarios:
- default: the base stock assessment with red tide events in 2005 and 2014.
- red tide random 10: I used a custom function to generate 10 random red tide events in the projected years.
- red tide random 25: I used a custom function to generate 25 random red tide events in the projected years.
- red tide regular 3: I added a red tide event every 3 years.
- red tide regular 5: I added a red tide event every 5 years.
- red tide regular 5 mortality 5: I added a red tide event every 5 years and set the OM mortality to 0.5.
Import the results and summary files from the cloud.
Warning: package 'tidyverse' was built under R version 4.4.3
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr 1.1.4 ✔ readr 2.1.5
✔ forcats 1.0.0 ✔ stringr 1.5.1
✔ ggplot2 3.5.1 ✔ tibble 3.2.1
✔ lubridate 1.9.4 ✔ tidyr 1.3.1
✔ purrr 1.0.2
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag() masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
Running SS_readdat_3.30
Read general model dimensions.
Read Fleet information.
Read bycatch data.
Read catches.
Read CPUE data.
Read discards.
Read Length composition data.
Read age composition data.
Read of data file complete. Final value = 999
Reviewing time series plots
List of the things we can plot with the ts_plot_variable function:
[1] "year" "Area" "Seas" "Bio_smry" "SpawnBio"
[6] "Recruit_0" "retainB_1" "retainN_1" "retainB_2" "retainN_2"
[11] "retainB_3" "retainN_3" "retainB_4" "retainN_4" "retainB_5"
[16] "retainN_5" "deadB_1" "deadN_1" "deadB_2" "deadN_2"
[21] "deadB_3" "deadN_3" "deadB_4" "deadN_4" "deadB_5"
[26] "deadN_5" "F_1" "F_2" "F_3" "F_4"
[31] "F_5" "SPRratio" "rec_dev" "raw_rec_dev" "model_run"
[36] "iteration" "scenario"
Here are the basic plots:
Long-Term SSB and Violin plots
These plots are similar to Doering et al. 2023
This plot takes the longest to process. It generates a plot of the SSB variation by scenario. Then it creates a series of violin plots with the OM and MS for Long-term average catch, Long-term catch variability, Short-term average catch, and Long-term average SSB.
This plot is similar to the Long-term catch variability plot [2] in the previous chunk, but this produces a plot of the coefficient of variation instead of Catch (metric tons).
This just combines the previous plots into a nice 2 by 2 patch work for easier viewing.
Reviewing derived quantities
Some of the same plots above but derived. Below is a list of all the derived quantity variables:
[1] "Value.SSB" "Value.Recr" "Value.SPRratio"
[4] "Value.F" "Value.Bratio" "Value.ForeCatch"
[7] "Value.OFLCatch" "Value.ForeCatchret" "Value.lnSPB"
[10] "year" "model_run" "iteration"
[13] "scenario"
General Brainstorm:
Quantify how often the stock crashes from red tide events? Quantify the loss of catch from each red tide event, then the average loss.
[1] "year" "Area" "Seas" "Bio_smry" "SpawnBio"
[6] "Recruit_0" "retainB_1" "retainN_1" "retainB_2" "retainN_2"
[11] "retainB_3" "retainN_3" "retainB_4" "retainN_4" "retainB_5"
[16] "retainN_5" "deadB_1" "deadN_1" "deadB_2" "deadN_2"
[21] "deadB_3" "deadN_3" "deadB_4" "deadN_4" "deadB_5"
[26] "deadN_5" "F_1" "F_2" "F_3" "F_4"
[31] "F_5" "SPRratio" "rec_dev" "raw_rec_dev" "model_run"
[36] "iteration" "scenario"
Terminal year with added mean line
Only years with red tide events
Fishing terminal year plots
I was redoing the mean lines and sds, and noticed that the EM:OM ratio would be NA if the EM F is zero (happens a lot in F_5). I added those NAs back in as zeros and it dramatically dampens the F_5 “spike”. So I filtered this data to only years where a red tide occurred to highlight that the spike in the terminal year trend is only relevant to red tide years.
All years, biomass ratios
I was redoing the mean lines and sds, and noticed that the EM:OM ratio would be NA if the EM F is zero (happens a lot in F_5). I added those NAs back in as zeros and it dramatically dampens the F_5 “spike”. So I filtered this data to only years where a red tide occurred to highlight that the spike in the terminal year trend is only relevant to red tide years.
Red tide years, biomass ratio
This is the biomass ratios in just the red tide years so the trends are more clear in Fleet 5.
Exploring Recruitment
“rec_dev” “raw_rec_dev” “Recruit_0”
Recruitment ratios, all years
This is the biomass ratios in just the red tide years so the trends are more clear in Fleet 5.
Terminal year recruitment ratios, all years
This is the biomass ratios in just the red tide years so the trends are more clear in Fleet 5.
Terminal year recruitment ratios, red tide years
This is the biomass ratios in just the red tide years so the trends are more clear in Fleet 5.
Terminal year SSB ratios, red tide years
This is the biomass ratios in just the red tide years so the trends are more clear in Fleet 5.
Inspired by Wetzel and Punt et al. 2011
I am going to attempt to make their Relative Error Plots.
RE = (E - T) / T
Variables of interest:
F_5, Recruit_0,
Warning: Removed 13 rows containing non-finite outside the scale range
(`stat_boxplot()`).
Warning: Removed 582 rows containing non-finite outside the scale range
(`stat_boxplot()`).
Warning: Removed 512 rows containing non-finite outside the scale range
(`stat_boxplot()`).
Then I may attempt to calculate RMSE
F-Ratios over time, All years
F-Ratios over time, All years
F-Ratios over time, All years
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'
# A tibble: 6 × 4
scenario n_years F_5_sum catch_sum
<chr> <int> <dbl> <dbl>
1 red_tide_random_10 10 130. 1781540.
2 red_tide_random_25 25 356. 3360769.
3 red_tide_regular_3 17 182. 2009516.
4 red_tide_regular_5 10 127. 1790006.
5 red_tide_regular_5_mortality_5 10 375. 3427792.
6 default NA 0 0
F4 Selectivity
[1] "LnQ_base_Rec_4"
[2] "Size_DblN_peak_Rec_4"
[3] "Size_DblN_top_logit_Rec_4"
[4] "Size_DblN_ascend_se_Rec_4"
[5] "Size_DblN_descend_se_Rec_4"
[6] "Size_DblN_start_logit_Rec_4"
[7] "Size_DblN_end_logit_Rec_4"
[8] "Retain_L_infl_Rec_4"
[9] "Retain_L_width_Rec_4"
[10] "Retain_L_asymptote_logit_Rec_4"
[11] "Retain_L_maleoffset_Rec_4"
[12] "DiscMort_L_infl_Rec_4"
[13] "DiscMort_L_width_Rec_4"
[14] "DiscMort_L_level_old_Rec_4"
[15] "DiscMort_L_male_offset_Rec_4"
[16] "Retain_L_infl_Rec_4_BLK1repl_1986"
[17] "Retain_L_width_Rec_4_BLK1repl_1986"
[18] "Retain_L_asymptote_logit_Rec_4_BLK1repl_1986"
[1] "minage.sel.1_RedTide_5" "maxage.sel.1_RedTide_5"
[1] "Value.SSB" "Value.Recr" "Value.SPRratio"
[4] "Value.F" "Value.Bratio" "Value.ForeCatch"
[7] "Value.OFLCatch" "Value.ForeCatchret" "Value.lnSPB"
[10] "year" "model_run" "iteration"
[13] "scenario"
[1] "year" "Area" "Seas" "Bio_smry" "SpawnBio"
[6] "Recruit_0" "retainB_1" "retainN_1" "retainB_2" "retainN_2"
[11] "retainB_3" "retainN_3" "retainB_4" "retainN_4" "retainB_5"
[16] "retainN_5" "deadB_1" "deadN_1" "deadB_2" "deadN_2"
[21] "deadB_3" "deadN_3" "deadB_4" "deadN_4" "deadB_5"
[26] "deadN_5" "F_1" "F_2" "F_3" "F_4"
[31] "F_5" "SPRratio" "rec_dev" "raw_rec_dev" "model_run"
[36] "iteration" "scenario"
[1] "SSB_Unfished"
[2] "Totbio_Unfished"
[3] "SmryBio_Unfished"
[4] "Recr_Unfished"
[5] "SSB_Btgt"
[6] "SPR_Btgt"
[7] "F_Btgt"
[8] "TotYield_Btgt"
[9] "SSB_SPR"
[10] "F_SPR"
[11] "TotYield_SPR"
[12] "SSB_MSY"
[13] "SPR_MSY"
[14] "F_MSY"
[15] "TotYield_MSY"
[16] "Ret_Catch_MSY"
[17] "max_grad"
[18] "depletion"
[19] "alt_sigma_r"
[20] "last_yr_early"
[21] "first_yr_full"
[22] "last_yr_full"
[23] "first_yr_recent"
[24] "max_bias_adj"
[25] "params_on_bound"
[26] "params_stuck_low"
[27] "params_stuck_high"
[28] "L_at_Amin_Fem_GP_1"
[29] "L_at_Amax_Fem_GP_1"
[30] "VonBert_K_Fem_GP_1"
[31] "CV_young_Fem_GP_1"
[32] "CV_old_Fem_GP_1"
[33] "Wtlen_1_Fem_GP_1"
[34] "Wtlen_2_Fem_GP_1"
[35] "Mat50._Fem_GP_1"
[36] "Mat_slope_Fem_GP_1"
[37] "Eggs_scalar_Fem_GP_1"
[38] "Eggs_exp_len_Fem_GP_1"
[39] "CohortGrowDev"
[40] "FracFemale_GP_1"
[41] "SR_LN_R0"
[42] "SR_BH_steep"
[43] "SR_sigmaR"
[44] "SR_regime"
[45] "SR_autocorr"
[46] "Early_InitAge_6"
[47] "Early_InitAge_5"
[48] "Early_InitAge_4"
[49] "Early_InitAge_3"
[50] "Early_InitAge_2"
[51] "Early_InitAge_1"
[52] "Early_RecrDev_1986"
[53] "Early_RecrDev_1987"
[54] "Early_RecrDev_1988"
[55] "Early_RecrDev_1989"
[56] "Early_RecrDev_1990"
[57] "Early_RecrDev_1991"
[58] "Early_RecrDev_1992"
[59] "ForeRecr_2021"
[60] "ForeRecr_2022"
[61] "ForeRecr_2023"
[62] "InitF_seas_1_flt_1commHL"
[63] "InitF_seas_1_flt_2commLL"
[64] "InitF_seas_1_flt_3commTrap"
[65] "InitF_seas_1_flt_4Rec"
[66] "LnQ_base_commHL_1"
[67] "LnQ_base_commLL_2"
[68] "LnQ_base_Rec_4"
[69] "LnQ_base_SEAMAP_Vid_6"
[70] "LnQ_base_SEAMAP_GF_7"
[71] "LnQ_base_NMFS_BLL_8"
[72] "LnQ_base_CBT_PRSurv_9"
[73] "LnQ_base_FWRI_RTD_10"
[74] "Size_DblN_peak_commHL_1"
[75] "Size_DblN_top_logit_commHL_1"
[76] "Size_DblN_ascend_se_commHL_1"
[77] "Size_DblN_descend_se_commHL_1"
[78] "Size_DblN_start_logit_commHL_1"
[79] "Size_DblN_end_logit_commHL_1"
[80] "Retain_L_infl_commHL_1"
[81] "Retain_L_width_commHL_1"
[82] "Retain_L_asymptote_logit_commHL_1"
[83] "Retain_L_maleoffset_commHL_1"
[84] "DiscMort_L_infl_commHL_1"
[85] "DiscMort_L_width_commHL_1"
[86] "DiscMort_L_level_old_commHL_1"
[87] "DiscMort_L_male_offset_commHL_1"
[88] "Size_DblN_peak_commLL_2"
[89] "Size_DblN_top_logit_commLL_2"
[90] "Size_DblN_ascend_se_commLL_2"
[91] "Size_DblN_descend_se_commLL_2"
[92] "Size_DblN_start_logit_commLL_2"
[93] "Size_DblN_end_logit_commLL_2"
[94] "Retain_L_infl_commLL_2"
[95] "Retain_L_width_commLL_2"
[96] "Retain_L_asymptote_logit_commLL_2"
[97] "Retain_L_maleoffset_commLL_2"
[98] "DiscMort_L_infl_commLL_2"
[99] "DiscMort_L_width_commLL_2"
[100] "DiscMort_L_level_old_commLL_2"
[101] "DiscMort_L_male_offset_commLL_2"
[102] "Size_DblN_peak_commTrap_3"
[103] "Size_DblN_top_logit_commTrap_3"
[104] "Size_DblN_ascend_se_commTrap_3"
[105] "Size_DblN_descend_se_commTrap_3"
[106] "Size_DblN_start_logit_commTrap_3"
[107] "Size_DblN_end_logit_commTrap_3"
[108] "Retain_L_infl_commTrap_3"
[109] "Retain_L_width_commTrap_3"
[110] "Retain_L_asymptote_logit_commTrap_3"
[111] "Retain_L_maleoffset_commTrap_3"
[112] "DiscMort_L_infl_commTrap_3"
[113] "DiscMort_L_width_commTrap_3"
[114] "DiscMort_L_level_old_commTrap_3"
[115] "DiscMort_L_male_offset_commTrap_3"
[116] "Size_DblN_peak_Rec_4"
[117] "Size_DblN_top_logit_Rec_4"
[118] "Size_DblN_ascend_se_Rec_4"
[119] "Size_DblN_descend_se_Rec_4"
[120] "Size_DblN_start_logit_Rec_4"
[121] "Size_DblN_end_logit_Rec_4"
[122] "Retain_L_infl_Rec_4"
[123] "Retain_L_width_Rec_4"
[124] "Retain_L_asymptote_logit_Rec_4"
[125] "Retain_L_maleoffset_Rec_4"
[126] "DiscMort_L_infl_Rec_4"
[127] "DiscMort_L_width_Rec_4"
[128] "DiscMort_L_level_old_Rec_4"
[129] "DiscMort_L_male_offset_Rec_4"
[130] "Size_inflection_SEAMAP_Vid_6"
[131] "Size_95.width_SEAMAP_Vid_6"
[132] "Size_DblN_peak_SEAMAP_GF_7"
[133] "Size_DblN_top_logit_SEAMAP_GF_7"
[134] "Size_DblN_ascend_se_SEAMAP_GF_7"
[135] "Size_DblN_descend_se_SEAMAP_GF_7"
[136] "Size_DblN_start_logit_SEAMAP_GF_7"
[137] "Size_DblN_end_logit_SEAMAP_GF_7"
[138] "Size_inflection_NMFS_BLL_8"
[139] "Size_95.width_NMFS_BLL_8"
[140] "Size_inflection_FWRI_RTD_10"
[141] "Size_95.width_FWRI_RTD_10"
[142] "minage.sel.1_RedTide_5"
[143] "maxage.sel.1_RedTide_5"
[144] "Retain_L_infl_commHL_1_BLK2repl_1986"
[145] "Retain_L_infl_commHL_1_BLK2repl_1990"
[146] "Retain_L_width_commHL_1_BLK2repl_1986"
[147] "Retain_L_width_commHL_1_BLK2repl_1990"
[148] "Retain_L_asymptote_logit_commHL_1_BLK2repl_1986"
[149] "Retain_L_asymptote_logit_commHL_1_BLK2repl_1990"
[150] "Retain_L_infl_commLL_2_BLK2repl_1986"
[151] "Retain_L_infl_commLL_2_BLK2repl_1990"
[152] "Retain_L_width_commLL_2_BLK2repl_1986"
[153] "Retain_L_width_commLL_2_BLK2repl_1990"
[154] "Retain_L_asymptote_logit_commLL_2_BLK2repl_1986"
[155] "Retain_L_asymptote_logit_commLL_2_BLK2repl_1990"
[156] "Retain_L_infl_commTrap_3_BLK3repl_1990"
[157] "Retain_L_width_commTrap_3_BLK3repl_1990"
[158] "Retain_L_asymptote_logit_commTrap_3_BLK3repl_1990"
[159] "Retain_L_infl_Rec_4_BLK1repl_1986"
[160] "Retain_L_width_Rec_4_BLK1repl_1986"
[161] "Retain_L_asymptote_logit_Rec_4_BLK1repl_1986"
[162] "dead.B.._1"
[163] "dead.B.._2"
[164] "dead.B.._3"
[165] "dead.B.._4"
[166] "dead.B.._5"
[167] "NLL_TOTAL"
[168] "NLL_Catch"
[169] "NLL_Equil_catch"
[170] "NLL_Survey"
[171] "NLL_Discard"
[172] "NLL_Length_comp"
[173] "NLL_Age_comp"
[174] "NLL_Recruitment"
[175] "NLL_InitEQ_Regime"
[176] "NLL_Forecast_Recruitment"
[177] "NLL_Parm_priors"
[178] "NLL_Parm_softbounds"
[179] "NLL_Parm_devs"
[180] "NLL_Crash_Pen"
[181] "Curr_Var_Adj_lcomp_flt_1_commHL"
[182] "Curr_Var_Adj_lcomp_flt_2_commLL"
[183] "Curr_Var_Adj_lcomp_flt_4_Rec"
[184] "Curr_Var_Adj_lcomp_flt_6_SEAMAP_Vid"
[185] "Curr_Var_Adj_lcomp_flt_7_SEAMAP_GF"
[186] "Curr_Var_Adj_lcomp_flt_8_NMFS_BLL"
[187] "Curr_Var_Adj_lcomp_flt_10_FWRI_RTD"
[188] "Curr_Var_Adj_agecomp_flt_1_commHL"
[189] "Curr_Var_Adj_agecomp_flt_2_commLL"
[190] "Curr_Var_Adj_agecomp_flt_3_commTrap"
[191] "Curr_Var_Adj_agecomp_flt_4_Rec"
[192] "version"
[193] "RunTime"
[194] "model_run"
[195] "hessian"
[196] "Niterations"
[197] "ForeRecr_2024"
[198] "ForeRecr_2025"
[199] "ForeRecr_2026"
[200] "ForeRecr_2027"
[201] "ForeRecr_2028"
[202] "ForeRecr_2029"
[203] "ForeRecr_2030"
[204] "ForeRecr_2031"
[205] "ForeRecr_2032"
[206] "ForeRecr_2033"
[207] "ForeRecr_2034"
[208] "ForeRecr_2035"
[209] "ForeRecr_2036"
[210] "ForeRecr_2037"
[211] "ForeRecr_2038"
[212] "ForeRecr_2039"
[213] "ForeRecr_2040"
[214] "ForeRecr_2041"
[215] "ForeRecr_2042"
[216] "ForeRecr_2043"
[217] "ForeRecr_2044"
[218] "ForeRecr_2045"
[219] "ForeRecr_2046"
[220] "ForeRecr_2047"
[221] "ForeRecr_2048"
[222] "ForeRecr_2049"
[223] "ForeRecr_2050"
[224] "ForeRecr_2051"
[225] "ForeRecr_2052"
[226] "ForeRecr_2053"
[227] "ForeRecr_2054"
[228] "ForeRecr_2055"
[229] "ForeRecr_2056"
[230] "ForeRecr_2057"
[231] "ForeRecr_2058"
[232] "ForeRecr_2059"
[233] "ForeRecr_2060"
[234] "ForeRecr_2061"
[235] "ForeRecr_2062"
[236] "ForeRecr_2063"
[237] "ForeRecr_2064"
[238] "ForeRecr_2065"
[239] "ForeRecr_2066"
[240] "ForeRecr_2067"
[241] "ForeRecr_2068"
[242] "ForeRecr_2018"
[243] "ForeRecr_2019"
[244] "ForeRecr_2020"
[245] "Late_RecrDev_2018"
[246] "Late_RecrDev_2019"
[247] "Late_RecrDev_2020"
[248] "Late_RecrDev_2021"
[249] "Late_RecrDev_2022"
[250] "Late_RecrDev_2023"
[251] "Late_RecrDev_2024"
[252] "Late_RecrDev_2025"
[253] "Late_RecrDev_2026"
[254] "Late_RecrDev_2027"
[255] "Late_RecrDev_2028"
[256] "Late_RecrDev_2029"
[257] "Late_RecrDev_2030"
[258] "Late_RecrDev_2031"
[259] "Late_RecrDev_2032"
[260] "Late_RecrDev_2033"
[261] "Late_RecrDev_2034"
[262] "Late_RecrDev_2035"
[263] "Late_RecrDev_2036"
[264] "Late_RecrDev_2037"
[265] "Late_RecrDev_2038"
[266] "Late_RecrDev_2039"
[267] "Late_RecrDev_2040"
[268] "Late_RecrDev_2041"
[269] "Late_RecrDev_2042"
[270] "Late_RecrDev_2043"
[271] "Late_RecrDev_2044"
[272] "Late_RecrDev_2045"
[273] "Late_RecrDev_2046"
[274] "Late_RecrDev_2047"
[275] "Late_RecrDev_2048"
[276] "Late_RecrDev_2049"
[277] "Late_RecrDev_2050"
[278] "Late_RecrDev_2051"
[279] "Late_RecrDev_2052"
[280] "Late_RecrDev_2053"
[281] "Late_RecrDev_2054"
[282] "Late_RecrDev_2055"
[283] "Late_RecrDev_2056"
[284] "Late_RecrDev_2057"
[285] "Late_RecrDev_2058"
[286] "Late_RecrDev_2059"
[287] "Late_RecrDev_2060"
[288] "Late_RecrDev_2061"
[289] "Late_RecrDev_2062"
[290] "Late_RecrDev_2063"
[291] "Late_RecrDev_2064"
[292] "Late_RecrDev_2065"
[293] "Late_RecrDev_2066"
[294] "Late_RecrDev_2067"
[295] "iteration"
[296] "scenario"
Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0.
ℹ Please use `linewidth` instead.